\(\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx\) [462]
Optimal result
Integrand size = 21, antiderivative size = 108 \[
\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\frac {x}{b^2}-\frac {2 a \left (a^2-2 b^2\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} b^2 (a+b)^{3/2} d}-\frac {a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}
\]
[Out]
x/b^2-2*a*(a^2-2*b^2)*arctan((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/(a-b)^(3/2)/b^2/(a+b)^(3/2)/d-a^2*sin
(d*x+c)/b/(a^2-b^2)/d/(a+b*cos(d*x+c))
Rubi [A] (verified)
Time = 0.18 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00, number of
steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2869, 2814, 2738, 211}
\[
\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx=-\frac {2 a \left (a^2-2 b^2\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d (a-b)^{3/2} (a+b)^{3/2}}-\frac {a^2 \sin (c+d x)}{b d \left (a^2-b^2\right ) (a+b \cos (c+d x))}+\frac {x}{b^2}
\]
[In]
Int[Cos[c + d*x]^2/(a + b*Cos[c + d*x])^2,x]
[Out]
x/b^2 - (2*a*(a^2 - 2*b^2)*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/((a - b)^(3/2)*b^2*(a + b)^(3/2
)*d) - (a^2*Sin[c + d*x])/(b*(a^2 - b^2)*d*(a + b*Cos[c + d*x]))
Rule 211
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]
Rule 2738
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]
Rule 2814
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]
Rule 2869
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(
-(b^2*c^2 - 2*a*b*c*d + a^2*d^2))*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1)*(a^2 - b^2))), x] -
Dist[1/(b*(m + 1)*(a^2 - b^2)), Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[b*(m + 1)*(2*b*c*d - a*(c^2 + d^2)) + (a
^2*d^2 - 2*a*b*c*d*(m + 2) + b^2*(d^2*(m + 1) + c^2*(m + 2)))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && LtQ[m, -1]
Rubi steps \begin{align*}
\text {integral}& = -\frac {a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac {\int \frac {a b+\left (a^2-b^2\right ) \cos (c+d x)}{a+b \cos (c+d x)} \, dx}{b \left (a^2-b^2\right )} \\ & = \frac {x}{b^2}-\frac {a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}-\frac {\left (a \left (a^2-2 b^2\right )\right ) \int \frac {1}{a+b \cos (c+d x)} \, dx}{b^2 \left (a^2-b^2\right )} \\ & = \frac {x}{b^2}-\frac {a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))}-\frac {\left (2 a \left (a^2-2 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^2 \left (a^2-b^2\right ) d} \\ & = \frac {x}{b^2}-\frac {2 a \left (a^2-2 b^2\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} b^2 (a+b)^{3/2} d}-\frac {a^2 \sin (c+d x)}{b \left (a^2-b^2\right ) d (a+b \cos (c+d x))} \\
\end{align*}
Mathematica [A] (verified)
Time = 0.40 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.95
\[
\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\frac {c+d x-\frac {2 a \left (a^2-2 b^2\right ) \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )}{\left (-a^2+b^2\right )^{3/2}}-\frac {a^2 b \sin (c+d x)}{(a-b) (a+b) (a+b \cos (c+d x))}}{b^2 d}
\]
[In]
Integrate[Cos[c + d*x]^2/(a + b*Cos[c + d*x])^2,x]
[Out]
(c + d*x - (2*a*(a^2 - 2*b^2)*ArcTanh[((a - b)*Tan[(c + d*x)/2])/Sqrt[-a^2 + b^2]])/(-a^2 + b^2)^(3/2) - (a^2*
b*Sin[c + d*x])/((a - b)*(a + b)*(a + b*Cos[c + d*x])))/(b^2*d)
Maple [A] (verified)
Time = 1.00 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.32
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}-\frac {2 a \left (\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b \right )}+\frac {\left (a^{2}-2 b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{2}}}{d}\) |
\(143\) |
default |
\(\frac {\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}-\frac {2 a \left (\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b \right )}+\frac {\left (a^{2}-2 b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{2}}}{d}\) |
\(143\) |
risch |
\(\frac {x}{b^{2}}-\frac {2 i a^{2} \left (a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}{b^{2} \left (a^{2}-b^{2}\right ) d \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,b^{2}}+\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,b^{2}}-\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}\) |
\(407\) |
| | |
|
|
|
[In]
int(cos(d*x+c)^2/(a+cos(d*x+c)*b)^2,x,method=_RETURNVERBOSE)
[Out]
1/d*(2/b^2*arctan(tan(1/2*d*x+1/2*c))-2*a/b^2*(a*b/(a^2-b^2)*tan(1/2*d*x+1/2*c)/(tan(1/2*d*x+1/2*c)^2*a-b*tan(
1/2*d*x+1/2*c)^2+a+b)+(a^2-2*b^2)/(a-b)/(a+b)/((a-b)*(a+b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b)
)^(1/2))))
Fricas [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (99) = 198\).
Time = 0.29 (sec) , antiderivative size = 470, normalized size of antiderivative = 4.35
\[
\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\left [\frac {2 \, {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d x \cos \left (d x + c\right ) + 2 \, {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d x - {\left (a^{4} - 2 \, a^{2} b^{2} + {\left (a^{3} b - 2 \, a b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - 2 \, {\left (a^{4} b - a^{2} b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{4} b^{3} - 2 \, a^{2} b^{5} + b^{7}\right )} d \cos \left (d x + c\right ) + {\left (a^{5} b^{2} - 2 \, a^{3} b^{4} + a b^{6}\right )} d\right )}}, \frac {{\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d x \cos \left (d x + c\right ) + {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d x - {\left (a^{4} - 2 \, a^{2} b^{2} + {\left (a^{3} b - 2 \, a b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) - {\left (a^{4} b - a^{2} b^{3}\right )} \sin \left (d x + c\right )}{{\left (a^{4} b^{3} - 2 \, a^{2} b^{5} + b^{7}\right )} d \cos \left (d x + c\right ) + {\left (a^{5} b^{2} - 2 \, a^{3} b^{4} + a b^{6}\right )} d}\right ]
\]
[In]
integrate(cos(d*x+c)^2/(a+b*cos(d*x+c))^2,x, algorithm="fricas")
[Out]
[1/2*(2*(a^4*b - 2*a^2*b^3 + b^5)*d*x*cos(d*x + c) + 2*(a^5 - 2*a^3*b^2 + a*b^4)*d*x - (a^4 - 2*a^2*b^2 + (a^3
*b - 2*a*b^3)*cos(d*x + c))*sqrt(-a^2 + b^2)*log((2*a*b*cos(d*x + c) + (2*a^2 - b^2)*cos(d*x + c)^2 - 2*sqrt(-
a^2 + b^2)*(a*cos(d*x + c) + b)*sin(d*x + c) - a^2 + 2*b^2)/(b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + a^2)) -
2*(a^4*b - a^2*b^3)*sin(d*x + c))/((a^4*b^3 - 2*a^2*b^5 + b^7)*d*cos(d*x + c) + (a^5*b^2 - 2*a^3*b^4 + a*b^6)
*d), ((a^4*b - 2*a^2*b^3 + b^5)*d*x*cos(d*x + c) + (a^5 - 2*a^3*b^2 + a*b^4)*d*x - (a^4 - 2*a^2*b^2 + (a^3*b -
2*a*b^3)*cos(d*x + c))*sqrt(a^2 - b^2)*arctan(-(a*cos(d*x + c) + b)/(sqrt(a^2 - b^2)*sin(d*x + c))) - (a^4*b
- a^2*b^3)*sin(d*x + c))/((a^4*b^3 - 2*a^2*b^5 + b^7)*d*cos(d*x + c) + (a^5*b^2 - 2*a^3*b^4 + a*b^6)*d)]
Sympy [F(-1)]
Timed out. \[
\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\text {Timed out}
\]
[In]
integrate(cos(d*x+c)**2/(a+b*cos(d*x+c))**2,x)
[Out]
Timed out
Maxima [F(-2)]
Exception generated. \[
\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\text {Exception raised: ValueError}
\]
[In]
integrate(cos(d*x+c)^2/(a+b*cos(d*x+c))^2,x, algorithm="maxima")
[Out]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
for more de
Giac [A] (verification not implemented)
none
Time = 0.32 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.62
\[
\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx=-\frac {\frac {2 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{2} b - b^{3}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )}} - \frac {2 \, {\left (a^{3} - 2 \, a b^{2}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{2} b^{2} - b^{4}\right )} \sqrt {a^{2} - b^{2}}} - \frac {d x + c}{b^{2}}}{d}
\]
[In]
integrate(cos(d*x+c)^2/(a+b*cos(d*x+c))^2,x, algorithm="giac")
[Out]
-(2*a^2*tan(1/2*d*x + 1/2*c)/((a^2*b - b^3)*(a*tan(1/2*d*x + 1/2*c)^2 - b*tan(1/2*d*x + 1/2*c)^2 + a + b)) - 2
*(a^3 - 2*a*b^2)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1
/2*d*x + 1/2*c))/sqrt(a^2 - b^2)))/((a^2*b^2 - b^4)*sqrt(a^2 - b^2)) - (d*x + c)/b^2)/d
Mupad [B] (verification not implemented)
Time = 20.89 (sec) , antiderivative size = 2872, normalized size of antiderivative = 26.59
\[
\int \frac {\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\text {Too large to display}
\]
[In]
int(cos(c + d*x)^2/(a + b*cos(c + d*x))^2,x)
[Out]
(2*atan((((((32*(2*a*b^8 - b^9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